import request from '@/utils/request'

export const ArticleApi = {

  /**
     *  分页
     * @returns
     */
  getPage: (data) => {
    return request({
      url: '/manage/cms/article/getPage',
      data,
      method: 'post'
    })
  },

  /**
     *  删除
     * @returns
     */
  delete: (id) => {
    return request({
      url: '/manage/cms/article/delete',
      params: { id },
      method: 'get'
    })
  },

  /**
     *  更新
     * @returns
     */
  edit: (data) => {
    return request({
      url: '/manage/cms/article/edit',
      data,
      method: 'post'
    })
  },

  /**
     *  插入
     * @returns
     */
  add: (data) => {
    return request({
      url: '/manage/cms/article/add',
      data,
      method: 'post'
    })
  },

  /**
     *  查询详细
     * @returns
     */
  getDetailById: (id) => {
    return request({
      url: '/manage/cms/article/getDetailById',
      params: { id },
      method: 'get'
    })
  }

}
